package cn.itcast.dubbo.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.service.UserService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/hello")
public class HelloController {
    @Reference
    private UserService userService;

    @RequestMapping("/sayHello")
    @ResponseBody
    public String sayHello(String name){
        System.out.println("舒服舒服");
        System.out.println("舒服舒服");
        return userService.userByName(name);

    }

}
